package com.db.morphia;

import org.mongodb.morphia.Datastore;

import com.db.morphia.entity.Actor;

public class MorphiaDemo {
	
	private static final String ip = "localhost";
	private static final int port = 27017;
	private static final String db = "morphia_test";
	private static final String entityPackage = "com.db.morphia.entity";

	public static void main(String[] args) {
		Datastore ds = MorphiaFactory.create(ip, port, db, entityPackage);
		ds.ensureIndexes();
		// 
		Actor actor = new Actor("斯巴达", true);
		ds.save(actor);
		ds.get(actor);
	}
}
